import { Graph } from "@antv/x6";
import * as FlowGraph from "../../core/create";
import { CustomGraphType } from "../type";
import HQGraph from "./HQGraph.vue";
import ConfigPane from "./ConfigPane.vue";
import { PORTS } from "../../default";

Graph.registerNode("HQGraph", {
	inherit: "vue-shape",
	width: 70,
	height: 70,
	component: {
		template: `<HQGraph />`,
		components: { HQGraph }
	},
	ports: PORTS,
	data: {
		type: CustomGraphType.蓄水洪区,
		vue: true
	}
});

FlowGraph.install(CustomGraphType.蓄水洪区, ({ graph, appendStencil }) => {
	appendStencil([graph.createNode({ shape: "HQGraph" })]);
	return { configPanel: ConfigPane };
});
